Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 9 - Script Objects / Inheritance and Delegation


Defining Inheritance

You define inheritance with the Parent property. A script object that includes a Parent property inherits the properties and handlers of the script object listed in the Parent property.

The script object listed in a Parent property definition is called the parent
script object,
or parent. A script object that includes a Parent property is referred to as a child script object, or child. The Parent property is not required. A script object can have many children, but a child script object can have only one parent.

The syntax for defining a parent script object is

( property | prop ) parent : variable
where

variable is a variable that contains the parent script object.

A script object must be initialized before it can be assigned as a parent of another script object. This means that the definition of the parent script object (or a command that calls a function that creates the parent script object) must come before the definition of the child in the same script.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996